<?php

namespace hiduoke\services;

use app\common\model\system\Config;
use hiduoke\services\sms\Sms;

/**
 * 短信服务
 * @package hiduoke\services
 * User: liuhongbin
 * Date: 2021-09-30 10:18
 */
class SmsService
{
    protected $config;
    /**
     * @var array
     */
    protected static $sms = [];


    public static function init()
    {
        $config = Config::get("sms");
        $type = $config['type'];
        if (isset(self::$sms['sms_' . $type])) {
            return self::$sms['sms_' . $type];
        }
        return self::$sms['sms_' . $type] = new Sms($type, $config);
    }

}
